<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>管理员表</title>
    <meta name="keywords" content="管理员表">
    <meta name="description" content="管理员表">
    <link href="__ADMINCSS__/bootstrap.min14ed.css" rel="stylesheet">
    <link href="__ADMINCSS__/font-awesome.min93e3.css" rel="stylesheet">
    <link href="__ADMINCSS__/plugins/iCheck/custom.css" rel="stylesheet">
    <link href="__ADMINCSS__/animate.min.css" rel="stylesheet">
    <link href="__ADMINCSS__/style.min.css" rel="stylesheet">
</head>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>管理员表</h5>
                </div>
                <div class="ibox-content">
                    <div class="row">
                        <div class="col-sm-2">
                            <div class="input-group">
                                <a href="{:U('add')}" class="btn btn-outline btn-primary ">添加管理员</a>
                            </div>
                        </div>
                        <form name="admin_list" id="admin_list" action="{:U()}" method="post">
                            <div class="col-sm-3">
                                <div class="input-group">
                                    <input type="text" placeholder="请输入关键词" class="input-sm form-control" name="word" id="word" value="{$word}">
                                    <span class="input-group-btn">
                                        <button type="submit" class="btn btn-sm btn-primary">搜 索</button>
                                    </span>
                                </div>
                            </div>
                        </form>
                    </div>
                    <div class="hr-line-dashed" style="margin: 10px"></div>
                    <div class="table-responsive">
                        <table class="table table-bordered">
                            <thead>
                            <tr>
                                <th>ID</th>
                                <th>管理员账号</th>
                                <th>头像</th>
                                <th>管理员角色</th>
                                <th>登录次数</th>
                                <th>最后登录时间</th>
                                <th>姓名</th>
                                <th>状态</th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            <tbody id="list_content">
                            <volist name="list" id="data">
                                <tr>
                                    <td>{$data.id}</td>
                                    <td>{$data.account}</td>
                                    <td>
                                        <empty name="data.headurl">
                                            <img alt="image" class="img-circle" src="/Public/static/admin/img/profile_small.jpg">
                                            <else />
                                            <img alt="image" class="img-circle" src="{$data.icon}">
                                        </empty>
                                    </td>
                                    <td>{$data.title}</td>
                                    <td>{$data['success_num']?$data['success_num']:0}</td>
                                    <td>{$data.last_login_time|date="Y-m-d H:i",###}</td>
                                    <td>{$data.real_name}</td>
                                    <td><a id="state{$data.id}" class="btn btn-{$data['status']?'primary':'danger'} btn-xs" href="javascript:;" onclick="changeState({$data.id})">{$data['status']?'正 常':'禁 用'}</a></td>
                                    <td>
                                        <a href="javascript:;" class="btn btn-primary btn-xs" onclick="edit({$data.id})"><i class="fa fa-edit"></i> 编 辑</a> &nbsp;&nbsp;
                                        <a href="javascript:;" class="btn btn-danger btn-xs" onclick="del({$data.id})"><i class="fa fa-trash-o"></i> 删 除</a>
                                    </td>
                                </tr>
                            </volist>
                            </tbody>
                        </table>
                        {$page}
                        <div id="listpage"></div>
                    </div>
                    <div class="spiner-example">
                        <div class="sk-spinner sk-spinner-three-bounce">
                            <div class="sk-bounce1"></div>
                            <div class="sk-bounce2"></div>
                            <div class="sk-bounce3"></div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="__ADMINJS__/jquery.min.js"></script>
<script src="__ADMINJS__/bootstrap.min.js"></script>
<script src="__ADMINJS__/plugins/layer/layer.min.js"></script>
<script src="__ADMINJS__/plugins/laypage/laypage.js"></script>
<script src="__ADMINJS__/plugins/laytpl/laytpl.js"></script>
<script src="__ADMINJS__/common.js"></script>
<script>
    //修改
    function edit(id){
        location.href = '/admin/admin/edit/id/'+id+'.html';
    }

    //删除
    function del(id){
        sxshop.del(id,"{:U('del')}","{:U()}")
    }
    //修改状态
    function changeState(id){
        var objectState = $('#state'+id);
        sxshop.state(id,"{:U('changeState')}",objectState);
    }
</script>
</body>
</html>
